package com.leejxx.apis.article;

import com.leejxx.model.article.dtos.ArticleDto;
import com.leejxx.model.article.pojos.ApAuthor;
import com.leejxx.model.common.dto.ResponseResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @Author LeeJx
 * @ClassName IArticleClient
 * @Description TODO
 * @date 2021/2/20 11:04
 * @Version 1.0
 */
@FeignClient("leadnews-article")
public interface IArticleClient {
    @GetMapping("/api/v1/author/findByUserId/{userId}")
    ApAuthor findByUserId(@PathVariable("userId") Integer userId);

    @PostMapping("/api/v1/author/save")
    ResponseResult save(@RequestBody ApAuthor apAuthor);

    @PostMapping("/api/v1/article/save")
    ResponseResult saveArticle(ArticleDto articleDto);

    @GetMapping("/api/v1/author/one/{id}")
    ApAuthor selectById(@PathVariable("id") Integer id);
}
